﻿<%@ Page Title="<%$ Concat:UIStrings.AutomaticTranslation,' &raquo; ResourceBlender.NET' %>" Language="C#" MasterPageFile="~/Layout.master" AutoEventWireup="true" CodeFile="MachineTranslate.aspx.cs" Inherits="MachineTranslate" %>
<%@ Register TagPrefix="L49" Namespace="Lime49.UI" %>
<%@ Register TagPrefix="Format" Namespace="ExpressionBuilders" %>

<asp:Content ID="cntHead" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="cntMain" ContentPlaceHolderID="cntMain" Runat="Server">
    <asp:ScriptManager ID="scrUpdateLanguages" runat="server"></asp:ScriptManager>
    <h1><asp:Literal ID="Literal4" runat="server" Text="<%$ Resources:UIStrings, AutomaticTranslation %>" /></h1>
    <div class="breadcrumbs">
        <asp:HyperLink ID="lnkNavHome" runat="server" NavigateUrl="~/Default.aspx">ResourceBlender.NET</asp:HyperLink> &gt; <asp:HyperLink ID="lnkNavResources" runat="server" NavigateUrl="~/ResourcesMain.aspx" Text="<%$ Resources:UIStrings, Resources %>" /> &gt; <asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:UIStrings, AutomaticTranslation %>" />
    </div>
    <div class="niceform">
        <asp:MultiView ID="mltMain" runat="server" ActiveViewIndex="0">
            <asp:View ID="viwNoApps" runat="server">
                <p><asp:Literal ID="litAddAppLink" runat="server" /></p>
            </asp:View>
            <asp:View ID="viwStartCopy" runat="server">
                <p><asp:Literal ID="litPageDescription" runat="server" /></p>
                <asp:UpdatePanel ID="updRadApplication" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <div id="blockContainer">
                            <asp:MultiView ID="mltProgress" runat="server" ActiveViewIndex="0">
                                <asp:View ID="viwInput" runat="server">
                                    <fieldset>
                                        <legend><asp:Literal ID="Literal2" runat="server" Text="<%$ Resources:UIStrings, ItemsToTranslate %>" /></legend>
                                        <div class="formrow block twocol">
                                            <div class="formcol">
                                                <label class="block"><asp:Literal ID="Literal3" runat="server" Text="<%$ Resources:UIStrings, Application %>" /></label>
                                                <asp:CheckBoxList ID="radApplication" runat="server" RepeatLayout="Flow" 
                                                    OnSelectedIndexChanged="ShowLanguages"
                                                    AutoPostBack="True" CssClass="checks applicationChecks plain" />
                                                <asp:Button ID="btnRefresh" runat="server" Text="<%$ Resources:UIStrings, RefreshBundlesLanguages %>"
                                                    OnClick="ShowLanguages" CssClass="uniformbutton doublewidth btnGo" />
                                            </div>
                                            <div class="formcol">
                                                <asp:Label ID="lblBundleName" runat="server" Text="<%$ Resources:UIStrings, Bundles %>" 
                                                    AssociatedControlID="lstBundles" CssClass="block"></asp:Label>
                                                <asp:ListBox ID="lstBundles" runat="server" SelectionMode="Multiple" 
                                                    Rows="10" Width="100%"></asp:ListBox>
                                            </div>
                                        </div>
                                    </fieldset>

                                    <fieldset>
                                        <legend><asp:Literal ID="Literal5" runat="server" Text="<%$ Resources:UIStrings, SourceLanguage %>" /></legend>
                                        <div class="formrow block twocol">
                                            <div class="formcol">
                                                <asp:Label ID="lblSourceLanguage" runat="server" AssociatedControlID="lstSourceLanguage" CssClass="block" Text="<%$ Resources:UIStrings, TranslateFrom %>" />
                                                <asp:ListBox ID="lstSourceLanguage" runat="server" SelectionMode="Single"
                                                    Rows="10" Width="100%"></asp:ListBox>
                                            </div>
                                            <div class="formcol">
                                                <asp:Label ID="lblSourceType" runat="server" AssociatedControlID="lstSourceType" CssClass="block" Text="<%$ Resources:UIStrings, TreatAs %>" />
                                                <asp:ListBox ID="lstSourceType" runat="server" SelectionMode="Single" 
                                                    Rows="10" Width="100%"></asp:ListBox>
                                            </div>
                                        </div>
                                    </fieldset>
                                    
                                    <fieldset>
                                        <legend><asp:Literal ID="Literal6" runat="server" Text="<%$ Resources:UIStrings, DestinationLanguage %>" /></legend>
                                        <div class="formrow block twocol">
                                            <div class="formcol">
                                                <asp:Label ID="lblDestinationLanguage" runat="server" AssociatedControlID="lstDestinationLanguage" CssClass="block" Text="<%$ Resources:UIStrings, FillTranslationsFor %>" />
                                                <asp:ListBox ID="lstDestinationLanguage" runat="server" SelectionMode="Single"
                                                    Rows="10" Width="100%"></asp:ListBox>
                                            </div>
                                            <div class="formcol">
                                                <asp:Label ID="lblDestinationType" runat="server" AssociatedControlID="lstDestinationType" CssClass="block" Text="<%$ Resources:UIStrings, TreatAs %>" />
                                                <asp:ListBox ID="lstDestinationType" runat="server" SelectionMode="Single" 
                                                    Rows="10" Width="100%"></asp:ListBox>
                                            </div>
                                        </div>
                                    </fieldset>
                                    
                                    <fieldset class="autowidth">
                                        <legend><asp:Literal ID="Literal7" runat="server" Text="<%$ Resources:UIStrings, Options %>" /></legend>
                                        <label class="block"><asp:Literal ID="litIfExists" runat="server" Text="<%$ Resources:UIStrings, IfDestinationLanguageExists %>" /></label>
                                        <asp:RadioButtonList ID="radIfExists" runat="server" RepeatLayout="Flow" 
                                            CssClass="checks applicationChecks plain">
                                            <asp:ListItem Value="leave" Text="<%$ Resources:UIStrings, LeaveExisting %>" Selected="True"></asp:ListItem>
                                            <asp:ListItem Value="overwrite" Text="<%$ Resources:UIStrings, OverwriteExistingMachine %>"></asp:ListItem>
                                        </asp:RadioButtonList>
                                        <div class="checks">
                                            <asp:CheckBox ID="chkVerbose" runat="server" Text="<%$ Resources:UIStrings, ShowDetailedProgress %>" CssClass="block" Checked="true" />
                                        </div>
                                    </fieldset>
                                    <asp:CustomValidator ID="vldLanguages" runat="server" ErrorMessage="" CssClass="error" ValidationGroup="starttrans"
                                        OnServerValidate="vldLanguages_ServerValidate" Display="Dynamic" ValidateEmptyText="true"></asp:CustomValidator>
                                    <div class="centered">
                                        <small>Powered By</small>
                                        <asp:Image ID="imgGoogleStep2" runat="server" ImageUrl="~/images/google_small.png" CssClass="block centered" AlternateText="Powered by Google Translate" />
                                    </div>
                                </asp:View>
                                <asp:View ID="viwProgress" runat="server">
                                    <asp:Timer ID="tmrProgress" runat="server" Enabled="false" Interval="2500" OnTick="tmrProgress_Tick">
                                    </asp:Timer>
                                    <h3><asp:Literal ID="Literal8" runat="server" Text="<%$ Resources:UIStrings, Progress %>" /></h3>
                                    <L49:FormattedList ID="lstProgress" runat="server">
                                    </L49:FormattedList>
                                    <asp:Image ID="imgProgress" runat="server" AlternateText="<%$ Resources:UIStrings, Translating %>" ImageUrl="images/ajax-small.gif" Visible="false" CssClass="block centered" />
                                </asp:View>
                            </asp:MultiView>
                            <div class="actions">
                                <asp:Button ID="btnStartTranslation" runat="server" Text="<%$ Resources:UIStrings, AutomaticallyTranslate %>" ValidationGroup="starttrans" 
                                    OnClick="btnStartTranslation_Click" CssClass="uniformbutton doublewidth btnGo" />
                            </div>
                        </div>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="tmrProgress" EventName="Tick" />
                        <asp:PostBackTrigger ControlID="btnStartTranslation" />
                    </Triggers>
                </asp:UpdatePanel>
            </asp:View>
        </asp:MultiView>
    </div>
</asp:Content>

